package com.ruoyi.activity.service;

import com.ruoyi.activity.domain.CouponActivity;
import com.ruoyi.activity.mapper.CouponActivityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 活动管理服务
 */
@Service
public class ActivityService {

    @Autowired
    private CouponActivityMapper activityMapper;

    /**
     * 新增活动
     */
    public void add(CouponActivity activity) {
        activity.setStatus(0);
        activityMapper.insert(activity);
    }

    /**
     * 修改活动
     */
    public void update(CouponActivity activity) {
        activityMapper.updateById(activity);
    }

    /**
     * 删除活动
     */
    public void delete(Long id) {
        activityMapper.deleteById(id);
    }

    /**
     * 查询活动列表
     */
    public List<CouponActivity> list() {
        return activityMapper.selectList(null);
    }
} 